{% extends "homepage.html" %}

{% block content %}

 <script src="{{ url_for('static', filename='jquery.column.min.js')}}" type="text/javascript" charset="utf-8"></script>
 <script src="{{ url_for('mwf.static', filename='maass_scripts.js')}}" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" charset="utf-8">
 $(document).ready(function() {
jQuery('table:has(col)').each(alignColumns);

var evTable = $("table#eigenvalues").dataTable(
{
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "{{url_for('mwf.get_table')}}",
             "fnServerData": function ( sSource, aoData, fnCallback ) {
                    jQuery.ajax( {
                        "dataType": 'json', 
                        "type": "POST", 
                        "url": sSource, 
                        "data": aoData, 
                        "success": fnCallback
                    } );
                },

   "aoColumns":[ {"sName": "colheads[0]", "sTitle": '{{KNOWL('mf.maass.mwf.level',title='Level') |safe}}',
                 "aaSorting":"asc","sWidth": "10%", "bSortable": true, "bSearchable": true ,"sType":"numeric", "fnRender":"text-align:center"},
                 {"sName": "{{colheads[1]}}","sTitle":'{{KNOWL('mf.maass.mwf.weight',title='Weight') |safe}}',
                  "sWidth": "10%", "bSortable": true,  "bSearchable": true, "sClass": "alignRight","fnRender":"text-align:right"},
                 {"sName": "{{colheads[2] |safe}}","sTitle":'{{KNOWL('mf.maass.mwf.character',title='Character') |safe}}',

                  "sWidth": "10%", "bSortable": false, "bSearchable": true, "sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[3] |safe}}","sTitle":'{{KNOWL('mf.maass.mwf.eigenvalue',title='Eigenvalue') |safe}}',
                 "sWidth": "15%", "bSortable": true,  "bSearchable": true, "sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[4] |safe}}","sTitle":'{{KNOWL('mf.maass.mwf.symmetry',title='Symmetry') |safe}}',
                  "sWidth": "10%", "bSortable": false, "bSearchable": false,"sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[5]}}","sTitle":'{{KNOWL('mf.maass.mwf.precision',title='Precision') |safe}}',
                  "sWidth": "10%", "bSortable": false, "bSearchable": false,"sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[6]}}","sTitle":'{{KNOWL('mf.maass.mwf.dimension',title='Mult.') |safe}}',
                  "sWidth": "5%", "bSortable": false, "bSearchable": false,"sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[7]}}","sTitle": '{{KNOWL('mf.maass.mwf.ncoefficients',title='Coeff') |safe}}',
                  "sWidth": "5%", "bSortable": false, "bSearchable": false,"sClass": "alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[8]}}","sTitle":'{{KNOWL('mf.maass.mwf.fricke',title='Fricke') |safe}}',
                 "sWidth": "5%", "bSortable": false, "bSearchable": false,"sClass":"alignLeft","fnRender":"text-align:left"},
                 {"sName": "{{colheads[9]}}","sTitle": '{{KNOWL('mf.maass.mwf.atkinlehner',title='Atkin-Lehner') |safe}}',
                 "sWidth": "15%", "bSortable":false, "bSearchable": false,"sClass":"alignLeft atkinl","fnRender":"text-align:left"}],

    "bSort":true,
    "iDisplayLength": 15,    
    "iDisplayStart": 0,
    "fnSort":[[1,"asc"],[2,"asc"],[3,"asc"]],
    "oLanguage": {
            "sZeroRecords": "There are no records that match your search criterion",
            "sLengthMenu": "Display _MENU_ records per page",
            "sInfo": "Displaying _START_ to _END_ of _TOTAL_ records",
            "sInfoEmpty": "Showing 0 to 0 of 0 records",
            "sInfoFiltered": "(filtered from _MAX_ total records)",
            "sSearch":"Filter records:",

     }, 
     "bjQueryUI":true,
     "sPaginationType": "full_numbers",
     "sDom": 'ti<"paging"p><"bottom"lfr><"filterbox"><"clear">',
     "sScorollX": "500px", 
     "bStateSave": false,
     "aLengthMenu": [[15, 25, 50, 100 ,200, -1], [15, 25, 50, 100, 200, "All"]],
     "bAutoWidth": false,
     "oSearch": { "sSearch": "", "bRegex": false, "bSmart": true },
 });

/* Add filtering box */

{% if wtis1 !='' %}
s='<input type="hidden" id="weight" value="1">'
$('#eigenvalues_filter').append(s);
{% elif wtis0 !='' %}
s='<input type="hidden" id="weight" value="0">'
$('#eigenvalues_filter').append(s);

{% else %}
s='<br>Weight:<select id="weight"><option selected>0<option>1<option >all </select>'
$('#eigenvalues_filter').append(s);
{% endif %}

{# $('#content').append($('#knowl')) #}

/* Add event listeners to the two range filtering inputs */
$('#weight').change( function() { evTable.fnDraw(); } );

$('.bottom').css("width","100%")
$('.bottom').css("text-align","left")
$('.atkinl').css("width","400px")

evTable.fnDraw(); 
$('#eigenvalues_length').css("width","50%")
$('#eigenvalues').css("width","875px")
$('#eigenvalues_wrapper').css("width","875px")
$('#eigenvalues_paginate').css("width","75%")
$('#eigenvalues_paginate').css("text-align","left")
$('.paging_full_numbers').css('width','400px')
$('#eigenvalues_first').css('padding','10px')
$('#eigenvalues_last').css('padding','10px')
$('#eigenvalues_next').css('padding','10px')
$('#eigenvalues_previous').css('padding','10px')

{#
$('#eigenvalues_length').css("width","400px")
$('#eigenvalues_length').css("text-align","left")
$('#eigenvalues_filter').css("width","100%")
$('#eigenvalues_wrapper').css("width","75%")
$('#eigenvalues_paginate').css("width","75%")
$('#eigenvalues_paginate').css("text-align","left")
$('.paging_full_numbers').css('width','400px')
$('#eigenvalues_first').css('padding','10px')
$('#eigenvalues_last').css('padding','10px')
$('#eigenvalues_next').css('padding','10px')
$('#eigenvalues_previous').css('padding','10px') #}
 });
</script>
<style type="text/css">
 .dataTables_wrapper { height: 100px; class:"ntdata"}
 .dataTables_wrapper:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
 td.sorting_1 {}
.alignLeft  {text-align:left}
 .dataTables_length {width:100%}
table.eigenvalues {clear:both}
}
a.paginate_button {
    padding:10px;
 } 
a.paginate_active {
    font-weight:bold;
    padding:10px;
 } 
</style>



{% if info.error is defined %}

<h1>There was an error in meeting your previous request. Please change parameters.</h1>

<div> 
<h2> Error message: </h2>

{{ info.error | safe }}
</div>
{% endif %}

<h1> Eigenvalues of {{KNOWL('mf.maass.mwf',title='Maass waveforms')}}</h1>

<h2>Eigenvalues</h2>
<table class="ntdata" id="eigenvalues">
</table>
{# <div id="knowl">
{{ KNOWL('metadata.knowl-tag') }}
</div>
#}
{% endblock content %}
